package com.ado.abyss.core.manager;

import com.ado.abyss.core.dal.model.SysUser;
import com.ado.abyss.core.dal.model.SysUserRole;
import com.ado.abyss.core.params.page.PageRequest;
import com.ado.abyss.core.params.page.PageResult;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Set;

/**
 * @author adonais
 * @date 2020/7/9
 * @description SysUserManager
 **/
public interface SysUserManager extends IService<SysUser> {

    /**
     *
     * @param username
     * @return
     */
    SysUser findByName(String username);

    /**
     *
     * @param name
     * @return
     */
    Set<String> findPermissions(String name);

    /**
     *
     * @param userId
     * @return
     */
    List<SysUserRole> findUserRoles(Long userId);

    /**
     *
     * @param pageRequest
     * @return
     */
    PageInfo<SysUser> findPage(PageRequest pageRequest);

    /**
     *
     * @param id
     * @return
     */
    SysUser getByUserId(Long id);

    /**
     *
     * @return
     */
    List<SysUser> findAll();

    /**
     *
     * @param ids
     * @return
     */
    boolean deleteByIds(List<Long> ids);

    /**
     *
     * @param record
     * @return
     */
    boolean saveUser(SysUser record);
}
